/*
 * Copyright 2010 Georgia Institute of Technology. All rights reserved.
 * Author: Karthik Narayan
 * 
 * Preferences.java: application configurations for the convex hull package
 * which allow cross-platform compatibility.
 */
package edu.gatech.cc.liam.core;

import java.text.DecimalFormat;
import java.util.Random;

public class Globals {

	public static final double TOLERANCE = 0.00000001;

	private static final long INITIAL_SEED = getNewSeed();
	private static long current_seed = INITIAL_SEED;
	public static final Random rand = new Random(INITIAL_SEED);//874506743956067L);
	
	public static final DecimalFormat decimal5 = new DecimalFormat("0.0####");
	
	public static long resetRandomSeed() {
		setSeed(getNewSeed());
		return current_seed;
	}
	public static void setSeed(long seed) {
		current_seed = seed;
		rand.setSeed(current_seed);
	}
	
	public static long getNewSeed(){
		return ++seedUniquifier + System.nanoTime();
	}
	private static volatile long seedUniquifier = 765213071458012L;

	public static long getCurrentSeed() {
		return current_seed;
	}
}
